 package srdb.migration.schema.metadata;
 
 import java.util.Enumeration;
 import java.util.Hashtable;
 
 public class Domain extends DBObject
 {
   private String name = null;
   private String dataType = null;
   private String defaultValue = null;
   private Hashtable<String, String> constraints = new Hashtable();
 
   public Domain(String domainName) {
     this.name = domainName;
   }
 
   public String getName()
   {
     return this.name;
   }
 
   public DBObject getParent()
   {
     return null;
   }
 
   public String getSchema()
   {
     return null;
   }
 
   public String getDataType()
   {
     return this.dataType;
   }
 
   public void setDataType(String dataType)
   {
     this.dataType = dataType;
   }
 
   public String getDefaultValue()
   {
     return this.defaultValue;
   }
 
   public void setDefaultValue(String defaultValue)
   {
     this.defaultValue = defaultValue;
   }
   public void addConstraint(String name, String definition) {
     if ((name != null) && (definition != null))
       this.constraints.put(name, definition);
   }
 
   public String getConstraints() {
     String str = "";
     Enumeration keys = this.constraints.keys();
     while (keys.hasMoreElements()) {
       String key = (String)keys.nextElement();
       String value = (String)this.constraints.get(key);
       str = str + "\nCONSTRAINT " + key + " " + value;
     }
     return str;
   }
 }

/* 

 * 
 */